<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>Module mod_actions</TITLE>
</HEAD>

<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
<BODY
 BGCOLOR="#FFFFFF"
 TEXT="#000000"
 LINK="#0000FF"
 VLINK="#000080"
 ALINK="#FF0000"
>
<!--#include virtual="header.html" -->
<H1 ALIGN="CENTER">Module mod_actions</h1>

This module is contained in the <code>mod_actions.c</code> file, and
is compiled in by default. It provides for
executing CGI scripts based on media type or request method. It is not
present in versions prior to Apache 1.1.

<h2>Summary</h2>

This module lets you run CGI scripts whenever a file of a certain type
is requested. This makes it much easier to execute scripts that
process files.

<h2>Directives</h2>
<ul>
<li><A HREF="#action">Action</A>
<li><A HREF="#script">Script</A>
</ul>

<hr>

<A name="action"><h2>Action</h2></A>
<strong>Syntax:</strong> Action <em>mime-type cgi-script</em><br>
<strong>Context:</strong> server config, virtual host, directory, .htaccess<br>
<strong>Override:</strong> FileInfo<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_actions<br>
<strong>Compatibility:</strong> Action is only available in Apache 1.1
and later<p>

This directive adds an action, which will activate <em>cgi-script</em> when
a file of content type <em>mime-type</em> is requested. It sends the
URL and file path of the requested document using the standard
CGI PATH_INFO and PATH_TRANSLATED environment variables.

<hr>

<A name="script"><h2>Script</h2></A>
<strong>Syntax:</strong> Script <em>method cgi-script</em><br>
<strong>Context:</strong> server config, virtual host, directory<br>
<strong>Status:</strong> Base<br>
<strong>Module:</strong> mod_actions<br>
<strong>Compatibility:</strong> Script is only available in Apache 1.1
and later<p>

<p>This directive adds an action, which will activate <em>cgi-script</em> when
a file is requested using the method of <em>method</em>, which can be
one of <code>GET</code>, <code>POST</code>, <code>PUT</code> or
<code>DELETE</code>. It sends the
URL and file path of the requested document using the standard
CGI PATH_INFO and PATH_TRANSLATED environment variables. 

<p>Note that the Script command defines default actions only. If a CGI
script is called, or some other resource that is capable of handling
the requested method internally, it will do so. Also note that script
with a method of <code>GET</code> will only be called if there are
query arguments present (e.g. foo.html?hi). Otherwise, the request
will proceed normally.

<p>Examples:
<pre>
    Script GET /cgi-bin/search     #e.g. for &lt;ISINDEX&gt;-style searching
    Script PUT /~bob/put.cgi

</pre>

<!--#include virtual="footer.html" -->
</BODY>
</HTML>

